Skip to content

feat(cli): decode firmware_version as the device release version - #204

Merged
calvinleng-science merged 3 commits into
mainfrom
calvin/change-firmware-version
Nov 20, 2026
Merged

calvinleng-science merged 3 commits into
mainfrom
calvin/change-firmware-version

Conversation

@calvinleng-science

@calvinleng-science calvinleng-science commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

synapsectl info decodes firmware_version into the device release version (e.g. Firmware Version: 2.5.0), using a new decode_firmware_version() next to decode_synapse_version().
Bumps to 2.10.1.

DeviceInfo.firmware_version (uint32) now carries the device release version from headstage's ops/release/manifest.toml, packed as 0xDDMMmmpp:

bits meaning
31-24 device: 1 = SciFi1, 2 = SciFi2
23-16 major
15-8 minor
7-0 patch

e.g. SciFi2 2.5.0 → 0x02020500, SciFi1 1.10.0 → 0x01010A00.

Backwards compatible: older firmware put its git hash in this field. Anything without a device byte of 1 or 2 is shown as that hash in hex, as before. I checked the release merge commits on headstage main (where release builds are made, as 8-char hashes): none starts with 01/02, so no released firmware gets misread. Only about 1 in 128 ad-hoc dev builds could.

Testing

  • synapse/tests/utils/test_version.py covers 2.5.0, 1.10.0 and the git-hash fallback.
  • Decoded a real SciFi2 running the new firmware: 0x2020500 → 2.5.0.

SciFi firmware now packs its release version into DeviceInfo.firmware_version (device byte 1/2, then major/minor/patch). synapsectl info shows it as e.g. 2.5.0; older firmware that sent a git hash still shows that hash in hex.
Copilot AI balanced review requested due to automatic review settings November 20, 2026 03:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The hex fallback drops leading zeroes from legacy eight-character commit hashes, producing incorrect prefixes that cannot reliably identify firmware in Git.

1 open issue
What changed in this PR

Updates synapsectl info to display packed firmware versions as readable device release versions, such as 2.5.0.

Changes:

  • Adds a firmware-version decoder for SciFi1 and SciFi2, with a hexadecimal fallback for legacy values.
  • Uses the decoder in the CLI while preserving Unknown for missing values.
  • Adds unit tests for both device encodings and the legacy fallback.
File Description
synapse/​utils/​version.py Adds firmware release decoding and legacy hexadecimal fallback.
synapse/​tests/​utils/​test_version.py Tests packed releases and a legacy hash.
synapse/​cli/​device_info_display.py Displays the decoded firmware version in device summaries.

Review effort: Balanced

Comment thread synapse/utils/version.py Resolved
Copilot AI balanced review requested due to automatic review settings November 20, 2026 21:49

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are recorded for the firmware-version display change.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 20, 2026 21:51
@calvinleng-science
calvinleng-science merged commit 1839bd2 into main Nov 20, 2026
3 checks passed
@calvinleng-science
calvinleng-science deleted the calvin/change-firmware-version branch November 20, 2026 21:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

There are no active review issues blocking the firmware-version display update.

No open issues 🎉

Review effort: Balanced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants